﻿#include "../../ctlHandle.h"

namespace swui
{
	void addMouseStayFontStyle(IFont* object, unsigned enterIndex)
	{
		unsigned leaveIndex = object->getFontIndex();
		object->addLambdaEvent(ctlMouseEventType::leave, 
			[=](ctlRoot*, ctlMouseEvent* me)
			{
				object->setFont(leaveIndex);
			} );
		object->addLambdaEvent(ctlMouseEventType::enter, 
			[=](ctlRoot*, ctlMouseEvent* me)
			{
				object->setFont(enterIndex);
			} );
	}
}